function run() {
    var task01 = createTask01();
    var solution01 = createTask01Solution(task01);
    var machine = new TuringMachine(task01.getInputTape(), solution01);

    for (var i = 0; i != 1000 && !machine.isHalted(); i += 1) {
        document.write(i.toString() + ": ");
        var range = task01.getInputTape().getTapeRange(-2, 30);
        document.write("&nbsp;&nbsp;&nbsp;&nbsp;");
        for (j in range) {
            if (j==machine.getCursor()+2) {
                document.write("<font color=aqua>"+range[j]+"</font>")
            } else {
                document.write(range[j])
            }
        }
        document.write("<br>");
        machine.nextStep();
    }

    if (task01.isCorrectSolution(machine.getTape(), machine.getCursor())) {
        document.write("The solution is correct");
    } else {
        document.write("The solution is not correct");
    }
};

run();